put char 1 to 3 of second word of getJDDate() && first word of getJDDate() into he
if not ((second word of he) = first word of field "date") then fetch he
pass openCard
end openCard
on fetch he
global rec
put "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC" into months
if he is empty then exit fetch
if number of chars of he=5 then put "0" after char 4 of he
-- import text put proper pathname here
put "Hard Disk:Astronomy:Galilean Eclipses:" & last word of the long date into fileName
repeat with month=1 to 12
if item month of months is in he then exit repeat
end repeat
if the shiftKey is up and number of lines of cd fld 1 ≠ 0 then
select text of cd fld 1
doMenu "Clear Text"
end if
put month&char 5 to 6 of he into target
open file fileName
repeat
set cursor to busy
read from file fileName until "&"
if it is empty then
exit repeat
end if
delete last char of it
if it contains target then
exit repeat
end if
if target < char 4 to 7 of line 2 of it then
get empty
exit repeat
end if
end repeat
put it into rec
close file fileName
put the number of lines of it into she
if she = 0 then
put "No Galilean Satellite Events for this date." into line 3 of card field 1
exit fetch
end if
put line 1 of it && return into card field 1
put "DATE Time(UT) SP Radii" & return into line 2 of card field 1
repeat with i=2 to she
put "(not visible)" into temp
put word 3 of line i of it into time
put (char 1 to 2 of time+(char 4 to 5 of time)/60+24-DSTcheck()) mod 24 into time
put line 3 of cd fld 1 of cd sun + .5 into str
put line 4 of cd fld 1 of cd sun - .5 into sts
put line 4 of fld 6 into jr
put line 5 of fld 6 into js
if time <str or time >sts then
if jr < 12 then
if time <jr or time >js then
put empty into temp
end if
else
if time >jr or time <js then
put empty into temp
end if
end if
end if
put item month of months&&char 5 to 6 of he&&word 3 of line i of it &&" "&word 1 of line i of it&&(word 4 of line i of it)/10 && temp & return after card field 1
end repeat
end fetch
-- part 16 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=398 top=181 right=205 bottom=437
-- title width / last selected line: 0
-- icon id / first selected line: 31949 / 31949
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Satellite
----- HyperTalk script -----
on mouseUp
get the seconds
add DSTcheck()*3600 to it
convert it to dateitems
put item 1 of it into line 3 of joe
put item 2 of it into line 1 of joe
put item 3 of it +(item 4 of it)/24 + (item 5 of it)/1440 into line 2 of joe
PutClipboard(joe)
open "JSAT"
end mouseUp
-- part 18 (field)
-- low flags: 00
-- high flags: 0007
-- rect: left=41 top=184 right=282 bottom=348
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 22
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: total
-- part 19 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=6 top=313 right=334 bottom=87
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Today
----- HyperTalk script -----
on mouseUp
put char 1 to 3 of second word of getJDDate() && first word of getJDDate() into he
fetch he
end mouseUp
-- part 21 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=283 top=313 right=334 bottom=364
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Other Days
----- HyperTalk script -----
on mouseUp
Ask "Enter date (mon dd):"
put it into he
fetch he
end mouseUp
-- part 22 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=90 top=313 right=334 bottom=171
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Tomorrow
----- HyperTalk script -----
on mouseUp
put char 1 to 3 of second word of TJDDate() && first word of TJDDate() into he